Page({
  data: {
    selectedFamily: null,
    date: [],
    week: ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'],
    doctor: null,
    isShowModel: false,
    isCancelModel : false
  },
  onShow(){
    let selectedFamily = getApp().globalData.selectedFamily;
    let x = selectedFamily[0];
    let y = selectedFamily[1];
    let id = getApp().globalData.selectedDoctor;
    this.setData({selectedFamily: getApp().globalData.families[x][y],doctor: getApp().globalData.doctors[id]});
    let d = new Date();
    let date = [];
    for(let i = 0; i < 3; i++){
      date.push({
        date: (d.getMonth() + 1) + '月' + d.getDate() + '日',
        day: d.getDay()
      }),
      d.setDate(d.getDate() + 1);
    }
    this.setData({date: date});
  },
  toOrder(){
    wx.navigateTo({
      url: '../order/order',
    })
  },
  showModel(){
    this.setData({isShowModel: true,isCancelModel: false});
  },
  cancelModel(){
   this.setData({isCancelModel: true});
   setTimeout(() =>{
     this.setData({isShowModel: false});
   },400);
  }
})